package com.wsd.smartcarwasher.dao;

import com.wsd.smartcarwasher.domain.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.dao.DataAccessException;

import java.util.List;

public interface UserInfoDao {

    List<UserInfo> getAllUserInfo(@Param("mobile") String mobile);

    int addUserInfo(UserInfo userInfo) throws DataAccessException;

    UserInfo findByUsername(String username) throws DataAccessException;

    UserInfo findByOpenId(String openId) throws DataAccessException;

    UserInfo findByUserId(@Param("userId") String userId) throws DataAccessException;

    //更新用户微信二维码链接
    int updateUserWxCodeUrl(@Param("userInfo") UserInfo userInfo) throws DataAccessException;

    int updateUserUnionId(@Param("userInfo") UserInfo userInfo) throws DataAccessException;

    List<UserInfo> queryUserWithRole(@Param("role") String role) throws DataAccessException;

    List<String> getAllUserId() throws DataAccessException;
    //根据 userid 修改用户手机号
    int updateUserMobileByOpenid(@Param("userInfo")UserInfo userInfo);
    //根据手机号查用户
    UserInfo findByMobile(String mobile);

}
